package com.ssfGame.puremvc.controller.cell
{
	import api.dataStruct.GameApiInfo;
	import api.event.CallFunName;
	
	import com.ssfGame.puremvc.StaticConst;
	import com.ssfGame.puremvc.view.application.SceneLayerMediator;
	import com.ssfGame.puremvc.view.mc.InitAPIBg;
	
	import org.puremvc.as3.interfaces.INotification;
	import org.puremvc.as3.patterns.command.SimpleCommand;
	
	public class InitPVPAPICommand extends SimpleCommand
	{
		public function InitPVPAPICommand()
		{
			super();
		}
		override public function execute(notification:INotification):void{
			
			init();
		}
		private function init():void{
			
			sendNotification(StaticConst.N_M_SCENE_LAYER_DEL,null,SceneLayerMediator.DEL_ALL);
			sendNotification(StaticConst.N_M_SCENE_LAYER_ADD,new InitAPIBg());
			StaticConst.apiCore.currClass=(this);
			StaticConst.apiCore.callAPIFun(CallFunName.A_SET_INIT_PVP);
			
		}
		public function setMyInfo(myInfo:GameApiInfo):void{
			StaticConst.myInfo=myInfo;
		}
		public function setUserInfo(userInfo:GameApiInfo):void{
			StaticConst.userInfo=userInfo;
		}
		public function startGame(data:Boolean):void{
			StaticConst.apiCore.isRobot=StaticConst.isRobot=data;;//是否和机器人玩,true:为机器人
			sendNotification(StaticConst.N_M_GAME_ADD);
		}
		public function debug(data:*):void{
			
		}
	}
}